package com.base.self.controller;

import com.base.log.LoginAn;
import com.base.result.ResponseResult;
import com.base.self.dto.commodityCallPlanDetail.CommodityCallPlanDetailWebAddDTO;
import com.base.self.dto.commodityCallPlanDetail.CommodityCallPlanDetailWebDelDTO;
import com.base.self.dto.commodityCallPlanDetail.CommodityCallPlanDetailWebListDTO;
import com.base.self.dto.commodityCallPlanDetail.CommodityCallPlanDetailWebUpdateDTO;
import com.base.self.service.ICommodityCallPlanDetailService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 话费礼包详情
 *
 * @author XiFYuW
 * @since 2020-12-20
 */
@RestController
@RequestMapping("/admin/commodityCallPlanDetail")
public class CommodityCallPlanDetailController {

    private final ICommodityCallPlanDetailService iCommodityCallPlanDetailService;

    public CommodityCallPlanDetailController(ICommodityCallPlanDetailService iCommodityCallPlanDetailService) {
        this.iCommodityCallPlanDetailService = iCommodityCallPlanDetailService;
    }

    @PostMapping(value = "/commodityCallPlanDetailWebList")
    @Validated
    @LoginAn(isRe = true)
    public ResponseResult commodityCallPlanDetailWebList(@Valid final CommodityCallPlanDetailWebListDTO commodityCallPlanDetailWebListDTO) {
        return iCommodityCallPlanDetailService.commodityCallPlanDetailWebList(commodityCallPlanDetailWebListDTO);
    }

    @PostMapping(value = "/commodityCallPlanDetailWebAdd")
    @Validated
    @LoginAn(isRe = true)
    public ResponseResult commodityCallPlanDetailWebAdd(@Valid final CommodityCallPlanDetailWebAddDTO commodityCallPlanDetailWebAddDTO) {
        return iCommodityCallPlanDetailService.commodityCallPlanDetailWebAdd(commodityCallPlanDetailWebAddDTO);
    }

    @PostMapping(value = "/commodityCallPlanDetailWebUpdate")
    @Validated
    @LoginAn(isRe = true)
    public ResponseResult commodityCallPlanDetailWebUpdate(@Valid final CommodityCallPlanDetailWebUpdateDTO commodityCallPlanDetailWebUpdateDTO) {
        return iCommodityCallPlanDetailService.commodityCallPlanDetailWebUpdate(commodityCallPlanDetailWebUpdateDTO);
    }

    @PostMapping(value = "/commodityCallPlanDetailWebDelete")
    @Validated
    @LoginAn(isRe = true)
    public ResponseResult commodityCallPlanDetailWebDelete(@Valid final CommodityCallPlanDetailWebDelDTO commodityCallPlanDetailWebDelDTO) {
        return iCommodityCallPlanDetailService.commodityCallPlanDetailWebDelete(commodityCallPlanDetailWebDelDTO);
    }
}

